import request from '@/utils/request'

export const getList = (params: any,page: number, limit: number) =>
  request({
    url: `/api/label/list?page=${page}&limit=${limit}`,
    method: 'get',
    params
  })
export const createLabel = (data: any) =>
  request({
    url: '/api/label/create',
    method: 'post',
    data
  })

export const updateLabel = (id: number, data: any) =>
  request({
    url: `/api/label/${id}`,
    method: 'put',
    data
  })

export const getLabel = (id: number) =>
  request({
    url: `/api/label/${id}`,
    method: 'get'
  })

export const deleteLabel = (id: number) =>
  request({
    url: `/api/label/${id}`,
    method: 'delete'
  })

export const deleteCollectLabel = (data: any) =>
  request({
    url: `/api/label/deleteCollect`,
    method: 'delete',
    data
  })

export const getLabelCollect = () =>
  request({
    url: '/api/label/collect',
    method: 'get',
  })
